﻿using System.Collections.Generic;

namespace BuzzX8.Xmpp.StreamElements.Builders
{
    public class StreamHeaderBuilder : DatagramElementBuilder<StreamHeader>
    {
        protected override void AddAttributeToRootElement(string name, string value)
        {
            switch (name)
            {
                case "version":
                    RootElement.Version = value;
                    break;

                default:
                    base.AddAttributeToRootElement(name, value);
                    break;
            }

        }

        protected override IEnumerable<string> GetSupportedElementNames()
        {
            return new [] {"stream:stream"};
        }

        protected override StreamHeader CreateNewElement(string name)
        {
            return new StreamHeader(StreamType.Client);
        }
    }
}
